package com.jzy.chatglmsdk18753goldn.session;

import com.jzy.chatglmsdk18753goldn.model.ChatCompletionCommonRequest;
import com.jzy.chatglmsdk18753goldn.model.ChatCompletionSyncResponse;
import com.jzy.chatglmsdk18753goldn.model.ImageCompletionRequest;
import com.jzy.chatglmsdk18753goldn.model.ImageCompletionResponse;
import okhttp3.sse.EventSource;
import okhttp3.sse.EventSourceListener;

import java.util.concurrent.CompletableFuture;

/**
 * @description 会话服务接口
 */
public interface OpenAiSession {

    EventSource completions(ChatCompletionCommonRequest chatCompletionRequest, EventSourceListener eventSourceListener) throws Exception;

    CompletableFuture<String> completions(ChatCompletionCommonRequest chatCompletionRequest) throws Exception;

    ChatCompletionSyncResponse completionsSync(ChatCompletionCommonRequest chatCompletionRequest) throws Exception;

    ImageCompletionResponse genImages(ImageCompletionRequest imageCompletionRequest) throws Exception;

    Configuration configuration();

}
